package com.nf.action;

import com.nf.entity.Office;
import com.opensymphony.xwork2.ActionSupport;

public class IndexAction extends ActionSupport {

    private Office office;

    public Office getOffice() {
        return office;
    }

    public void setOffice(Office office) {
        this.office = office;
    }

    /*忽略其它内容*/
    @Override
    public String execute() {
        //这里按理应该有判断session是否为null的代码
        //我们把这段代码称为横切关注点
        //交给拦截器来完成

        //模拟从数据库取出来的值
        office = new Office();
        office.setName("1号办公室");
        return this.SUCCESS;
    }
}
